<?php
class News_model extends MY_Model {
	private $list_cat;
    function __construct(){
        parent::__construct();
        $this->list_cat = $this->cm->get_all('cat',array('type'=>'article'),'arr');
    }
    
    function get_by_page(){
    	$query = $this->db ->from('news')
    		->get();
    	$list = $query->result();
    	foreach ($list as $k=>$v){
    		$list[$k]->cname = getCatFname($this->list_cat, $v->cid,' &gt; ');
    	}
    	return $list;
    }
}